<%@ page language="java" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <%
        String path = request.getContextPath();
        String http = request.getScheme();
        String ips = request.getServerName();
        int port = request.getServerPort();
//        http://localhost:8082/shop/
        String basePath = http+"://"+ips+":"+port+path+"/";
    %>
    <base href="<%=basePath%>">
    <title>用户登录</title>
    <link rel="icon" type="image/x-icon" href="${pageContext.request.contextPath}/resources/images/favicon.ico"/>
    <link type="text/css" href="${pageContext.request.contextPath}/resources/css/regLogin.css" rel="stylesheet">
</head>

<body>
<div class="box log">
    <form action="${pageContext.request.contextPath}/LoginServlet" method="post">
        <div class="login">
            <h2>
                登录
            </h2>
            <p>
                <span>用户名:</span><input type="text" name="username"/>
            </p>
            <p>
                <span>密&emsp;码:</span><input type="password" name="password"/>
            </p>
            <p>
                <span>角&emsp;色:</span>
                <label>
                    <input type="radio" name="role" value="2"/>用户
                    <input type="radio" name="role" value="1"/>管理员
                </label>
            </p>
            <p>
                <input id="log" type="submit" value="登录"/>
            </p>
            <p style="color: red">
                ${requestScope.msg}
            </p>
            <p>
                还没有账号？<a href="${pageContext.request.contextPath}/ToRegisterServlet">立即注册</a>
            </p>
        </div>
    </form>
</div>
</body>
</html>
